<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
<meta name="theme-color" content="#222">












<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />






















<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=6.1.0" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.1.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=6.1.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico?v=6.1.0">


  <link rel="mask-icon" href="/images/logo.svg?v=6.1.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '6.1.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="更新日志    2017-12-08: 创建   一、Intel_Parallel_Studio_XE 进入解压后的目录，修改权限  12cd /home/当前用户/安装包/chmod -R +rwx /home/当前用户/安装包/  运行安装脚本 ./install.sh 一直敲回车  到 view license，一路空格，最后==输入accept==然后回车 到 Alternative ac">
<meta name="keywords" content="Computational Chemistry,VASP">
<meta property="og:type" content="article">
<meta property="og:title" content="VASP 的编译安装">
<meta property="og:url" content="http://yoursite.com/vasp_install/index.html">
<meta property="og:site_name" content="胖勇の小窝">
<meta property="og:description" content="更新日志    2017-12-08: 创建   一、Intel_Parallel_Studio_XE 进入解压后的目录，修改权限  12cd /home/当前用户/安装包/chmod -R +rwx /home/当前用户/安装包/  运行安装脚本 ./install.sh 一直敲回车  到 view license，一路空格，最后==输入accept==然后回车 到 Alternative ac">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-06-03T07:33:04.499Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="VASP 的编译安装">
<meta name="twitter:description" content="更新日志    2017-12-08: 创建   一、Intel_Parallel_Studio_XE 进入解压后的目录，修改权限  12cd /home/当前用户/安装包/chmod -R +rwx /home/当前用户/安装包/  运行安装脚本 ./install.sh 一直敲回车  到 view license，一路空格，最后==输入accept==然后回车 到 Alternative ac">






  <link rel="canonical" href="http://yoursite.com/vasp_install/"/>



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>VASP 的编译安装 | 胖勇の小窝</title>
  









  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">胖勇の小窝</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button aria-label="Toggle navigation bar">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>




<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
          
  
  <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页</a>
</li>

      
        
        
          
  
  <li class="menu-item menu-item-about">
    <a href="/about/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于</a>
</li>

      
        
        
          
  
  <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />标签</a>
</li>

      
        
        
          
  
  <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br />分类</a>
</li>

      
        
        
          
  
  <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档</a>
</li>

      

      
      
    </ul>
  

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/vasp_install/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="LiuGaoyong">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="http://p7b7this6.bkt.clouddn.com/18-6-3/47273717.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="胖勇の小窝">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">VASP 的编译安装
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
                
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-06-08T10:09:19+08:00">2017-06-08</time>
            

            
            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/化学/" itemprop="url" rel="index"><span itemprop="name">化学</span></a></span>

                
                
                  ， 
                
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/化学/计算化学软件安装/" itemprop="url" rel="index"><span itemprop="name">计算化学软件安装</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <font size="4" face="黑体">更新日志</font> 

<blockquote>
<p>2017-12-08: 创建</p>
</blockquote>
<hr>
<h2 id="一、Intel-Parallel-Studio-XE"><a href="#一、Intel-Parallel-Studio-XE" class="headerlink" title="一、Intel_Parallel_Studio_XE"></a>一、Intel_Parallel_Studio_XE</h2><ul>
<li>进入解压后的目录，修改权限</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /home/当前用户/安装包/</span><br><span class="line">chmod -R +rwx /home/当前用户/安装包/</span><br></pre></td></tr></table></figure>
<ul>
<li>运行安装脚本 <code>./install.sh</code></li>
<li>一直敲回车 </li>
<li>到 view license，一路空格，最后==输入accept==然后回车</li>
<li>到 Alternative activation, 选择 use a license file, provide the full path, 输入：目录/lic文件名 （具体内容可能有出入）</li>
<li>可选择Typical Install全部安装，或只安装inter fortran composer, 安装包具体内容可参考说明文件。</li>
<li>目录（<code>默认/opt/intel</code>）已存在，因为里面放了刚才的lic文件，所以无所谓，overwrite yes。后面省略，安装完成。</li>
<li>加入环境变量</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">vim ~/.bashrc</span><br><span class="line"></span><br><span class="line"><span class="comment"># add the following</span></span><br><span class="line"><span class="built_in">source</span> /opt/intel/bin/ifortvars.sh intel64</span><br><span class="line"><span class="built_in">source</span> /opt/intel/mkl/bin/mklvars.sh intel64</span><br></pre></td></tr></table></figure>
<h2 id="二、openMPI"><a href="#二、openMPI" class="headerlink" title="二、openMPI"></a>二、openMPI</h2><h3 id="1-需要的安装包（官网）"><a href="#1-需要的安装包（官网）" class="headerlink" title="1. 需要的安装包（官网）"></a><strong>1. 需要的安装包（<a href="http://www.open-mpi.org/" target="_blank" rel="noopener">官网</a>）</strong></h3><h3 id="2-安装步骤："><a href="#2-安装步骤：" class="headerlink" title="2. 安装步骤："></a><strong>2. 安装步骤：</strong></h3><ul>
<li>解压openMPI安装包 <code>tar zxcf 文件名</code></li>
<li><p>编译，终端输入</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> </span><br><span class="line">mkdir openmpi_compiled</span><br><span class="line">sudo mv openmpi_compiled /opt</span><br><span class="line">./configure --prefix=/opt/openmpi_compiled F77=ifort FC=ifort \</span><br><span class="line">        <span class="comment">#CC=icc CXX=icpc F77=ifort FC=ifort 若不加，则用gcc编译</span></span><br><span class="line">make -j8 <span class="comment">#采用八核心加快编译</span></span><br><span class="line">make install</span><br></pre></td></tr></table></figure>
</li>
<li><p>添加以下内容到 <code>.bashrc</code>文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># openMPI setup</span></span><br><span class="line"><span class="built_in">export</span> MPI_HOME=/hoopt/openmpi_compiled</span><br><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$PATH</span>:<span class="variable">$MPI_HOME</span>/bin</span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=<span class="variable">$LD_LIBRARY_PATH</span>:<span class="variable">$MPI_HOME</span>/lib</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="3-测试mpi效果："><a href="#3-测试mpi效果：" class="headerlink" title="3. 测试mpi效果："></a><strong>3. 测试mpi效果：</strong></h3><ul>
<li>测试环境变量</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> <span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$LD_LIBRARY_PATH</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#结果中显示有刚才的bin和lib路径则为配置成功</span></span><br></pre></td></tr></table></figure>
<ul>
<li>测试<code>mpirun</code></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">which</span> mpirun</span><br><span class="line">mpif90 -v <span class="comment">#检查版本</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#结果中显示 /opt/openmpi_compiled/bin/mpirun 则为配置成功</span></span><br></pre></td></tr></table></figure>
<ul>
<li>测试<code>mpi</code>代码 （使用普通账户）</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /openmpi源代码目录/examples</span><br><span class="line">make</span><br><span class="line">mpirun -np 2 hello_c  <span class="comment">#2为双核</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#结果中显示以下内容则为配置成功</span></span><br><span class="line"><span class="comment">#   Hello, world, I am 0 of 2</span></span><br><span class="line"><span class="comment">#   Hello, world, I am 1 of 2</span></span><br></pre></td></tr></table></figure>
<h2 id="三、编译VASP"><a href="#三、编译VASP" class="headerlink" title="三、编译VASP"></a>三、编译VASP</h2><h3 id="1-测试环境变量"><a href="#1-测试环境变量" class="headerlink" title="1. 测试环境变量"></a>1. <strong>测试环境变量</strong></h3><ul>
<li><h4 id="查看Intel-compiled环境"><a href="#查看Intel-compiled环境" class="headerlink" title="查看Intel_compiled环境"></a><strong>查看Intel_compiled环境</strong></h4></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">which</span> ifort    <span class="comment">#Fortran编译器</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$MKLROOT</span>  <span class="comment">#MKL环境</span></span><br><span class="line"><span class="built_in">which</span> mpiifort <span class="comment">#MPI环境：. /opt/intel/impi/5.0.2.044/bin64/mpivars.sh intel64</span></span><br></pre></td></tr></table></figure>
<ul>
<li><h4 id="查看Intel-fftw环境"><a href="#查看Intel-fftw环境" class="headerlink" title="查看Intel_fftw环境"></a><strong>查看Intel_fftw环境</strong></h4></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">ll <span class="variable">$MKLROOT</span>/interfaces/fftw3xf/libfftw3xf_intel.a</span><br><span class="line"></span><br><span class="line"><span class="comment"># 如没存在，那么可以在自己目录下编译生成libfftw3xf_intel.a：</span></span><br><span class="line"><span class="built_in">cd</span> /opt/intel/mkl/interfaces/</span><br><span class="line">cp -a fftw3xf ~/</span><br><span class="line">sudo cp -a fftw3xf fftw3xf_bkp</span><br><span class="line"><span class="built_in">cd</span> ~/fftw3xf</span><br><span class="line">make libintel64</span><br><span class="line"><span class="comment">#顺利的话，将在此目录下生成libfftw3xf_intel.a。</span></span><br><span class="line">sudo cp -a ~/fftw3xf /opt/intel/mkl/interfaces</span><br></pre></td></tr></table></figure>
<h3 id="2-vasp源代码整理"><a href="#2-vasp源代码整理" class="headerlink" title="2. vasp源代码整理"></a>2. <strong>vasp源代码整理</strong></h3><ul>
<li><h4 id="解压"><a href="#解压" class="headerlink" title="解压"></a><strong>解压</strong></h4></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span></span><br><span class="line">tar zxvf vasp源码包</span><br><span class="line">tar zxvf vasp.lib包</span><br></pre></td></tr></table></figure>
<ul>
<li><h4 id="整合VTST（可选）"><a href="#整合VTST（可选）" class="headerlink" title="整合VTST（可选）"></a><strong>整合VTST（可选）</strong></h4></li>
</ul>
<h5 id="a-源代码中加入VTST："><a href="#a-源代码中加入VTST：" class="headerlink" title="a. 源代码中加入VTST："></a><strong>a. 源代码中加入VTST：</strong></h5><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> vasp.X.X.X <span class="comment"># 解压缩后的根目录</span></span><br><span class="line">wget http://theory.cm.utexas.edu/code/vtstcode.tgz</span><br><span class="line">tar xvf vtstcode.tgz</span><br><span class="line">cp vtstcode-XXX/* src/</span><br></pre></td></tr></table></figure>
<h5 id="b-修改src-main-F源码："><a href="#b-修改src-main-F源码：" class="headerlink" title="b. 修改src/main.F源码："></a><strong>b. 修改src/main.F源码：</strong></h5><figure class="highlight fortran"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">!修改约第3233行</span></span><br><span class="line"><span class="comment">!CALL CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &amp;</span></span><br><span class="line"><span class="comment">!     LATT_CUR%A,LATT_CUR%B,IO%IU6)</span></span><br><span class="line"><span class="comment">!变为（注意最后一行）：</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CALL</span> CHAIN_FORCE(T_INFO%NIONS,DYN%POSION,TOTEN,TIFOR, &amp;</span><br><span class="line">      TSIF,LATT_CUR%A,LATT_CUR%B,IO%IU6)</span><br></pre></td></tr></table></figure>
<h5 id="c-修改编译配置src-objects："><a href="#c-修改编译配置src-objects：" class="headerlink" title="c. 修改编译配置src/.objects："></a><strong>c. 修改编译配置src/.objects：</strong></h5><figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#在chain.o前（大概第67行）添加如下内容：</span></span><br><span class="line"></span><br><span class="line">bfgs.o dynmat.o instanton.o lbfgs.o sd.o cg.o dimer.o bbm.o \</span><br><span class="line">fire.o lanczos.o neb.o qm.o opt.o \</span><br><span class="line"></span><br><span class="line"><span class="comment">#注意\后不能有空格！！！</span></span><br></pre></td></tr></table></figure>
<h3 id="3-vasp正式编译"><a href="#3-vasp正式编译" class="headerlink" title="3. vasp正式编译"></a>3. <strong>vasp正式编译</strong></h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cp arch/makefile.include.linux_intel makefile.include</span><br><span class="line">make   <span class="comment">#默认编译（将编译生成std、gam和ncl版）</span></span><br><span class="line"><span class="comment">#编译完成后将在bin目录下生成对应的版本的可执行程序：vasp_gam、vasp_ncl、vasp_std</span></span><br></pre></td></tr></table></figure>
<h2 id="四、VASP执行脚本"><a href="#四、VASP执行脚本" class="headerlink" title="四、VASP执行脚本"></a>四、VASP执行脚本</h2><h3 id="1-单主机并行脚本"><a href="#1-单主机并行脚本" class="headerlink" title="1. 单主机并行脚本"></a>1. 单主机并行脚本</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># 配置Intel compiler &amp; MKL &amp; MPI 环境变量</span></span><br><span class="line"><span class="built_in">source</span> /opt/intel/bin/ifortvars.sh intel64</span><br><span class="line"><span class="built_in">source</span> /opt/intel/mkl/bin/mklvars.sh intel64</span><br><span class="line"><span class="built_in">source</span> /opt/intel/impi/5.0.2.044/bin64/mpivars.sh intel64</span><br><span class="line"><span class="comment"># 执行VASP</span></span><br><span class="line">mpirun -np <span class="variable">$1</span> /VASP编译主目录/bin/vasp_std</span><br></pre></td></tr></table></figure>
<ul>
<li>将上述内容保存至文本文件vasp中，</li>
<li>赋予可执行权限，</li>
<li>而后将其添加到PATH环境变量中</li>
<li>进入VASP输入文件所在目录，执行<code>vasp CORE_NUMBER</code>即可</li>
</ul>
<h3 id="2-torque集群脚本（PBS）"><a href="#2-torque集群脚本（PBS）" class="headerlink" title="2. torque集群脚本（PBS）"></a>2. torque集群脚本（PBS）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment">#PBS -q batch</span></span><br><span class="line"><span class="comment">#PBS -N vasp</span></span><br><span class="line"><span class="comment">#PBS -l nodes=1:ppn=4</span></span><br><span class="line"><span class="comment">#PBS -j oe</span></span><br><span class="line"><span class="comment">#PBS -V</span></span><br><span class="line"><span class="comment">#PBS -l walltime=1500:00:00</span></span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=/<span class="built_in">export</span>/home/cluser1/intel/composerxe/mkl/lib/intel64:<span class="variable">$LD_LIBRARY_PATH</span></span><br><span class="line"><span class="built_in">source</span> /<span class="built_in">export</span>/home/cluser1/intel/composerxe/bin/compilervars.sh intel64</span><br><span class="line"><span class="built_in">export</span> PATH=/<span class="built_in">export</span>/home/cluser1/intel/composerxe/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=/<span class="built_in">export</span>/home/cluser1/intel/composerxe/mkl/lib/intel64:<span class="variable">$LD_LIB</span></span><br><span class="line">RARY_PATH</span><br><span class="line"><span class="built_in">export</span></span><br><span class="line">LD_LIBRARY_PATH=/<span class="built_in">export</span>/home/cluser1/intel/lib/intel64:<span class="variable">$LD_LIBRARY_PATH</span></span><br><span class="line"><span class="built_in">export</span> PATH=/<span class="built_in">export</span>/home/cluser1/openmpi-1.6.5-intel-v12.1.5/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=/<span class="built_in">export</span>/home/cluser1/openmpi-1.6.5-intel-v12.1.5/lib:<span class="variable">$LD_LIBR</span></span><br><span class="line">ARY_PATH</span><br><span class="line"><span class="built_in">export</span> MANPATH=/<span class="built_in">export</span>/home/cluser1/openmpi-1.6.5-intel-v12.1.5/share/man:<span class="variable">$MANPATH</span></span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$PBS_O_WORKDIR</span></span><br><span class="line">EXEC=/VASP主目录/bin/vasp_gam</span><br><span class="line">LOG_FILE=vasptest.log</span><br><span class="line">NP=`cat <span class="variable">$PBS_NODEFILE</span> | wc -l`</span><br><span class="line">NN=`cat <span class="variable">$PBS_NODEFILE</span> | sort | uniq | tee /tmp/nodes.$$ | wc -l`</span><br><span class="line">cat <span class="variable">$PBS_NODEFILE</span> &gt; /tmp/nodefile.$$</span><br><span class="line">mpirun -n <span class="variable">$NP</span> <span class="variable">$EXEC</span></span><br><span class="line">rm -f /tmp/nodefile.$$</span><br></pre></td></tr></table></figure>
<hr>
<h2 id="参考网址"><a href="#参考网址" class="headerlink" title="参考网址"></a>参考网址</h2><ul>
<li><p><a href="http://blog.csdn.net/txcokokok/article/details/42219099" target="_blank" rel="noopener">linux ubuntu12.04 下的 vasp 5.2 的安装方法</a></p>
</li>
<li><p><a href="http://bbs.keinsci.com/thread-4267-1-1.html" target="_blank" rel="noopener">教你从头编译vasp-5.4.1</a></p>
</li>
<li><p><a href="http://scc.ustc.edu.cn/zlsc/jsrj/201703/t20170330_273337.html/" target="_blank" rel="noopener">VASP 5.4.1+VTST编译安装</a></p>
</li>
</ul>

      
    </div>

    

    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Computational-Chemistry/" rel="tag"># Computational Chemistry</a>
          
            <a href="/tags/VASP/" rel="tag"># VASP</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/amber_install/" rel="next" title="Amber 14 单核版+并行版安装">
                <i class="fa fa-chevron-left"></i> Amber 14 单核版+并行版安装
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/gaussian-0/" rel="prev" title="第一次Gaussian计算">
                第一次Gaussian计算 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="http://p7b7this6.bkt.clouddn.com/18-6-3/47273717.jpg"
                alt="LiuGaoyong" />
            
              <p class="site-author-name" itemprop="name">LiuGaoyong</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">22</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">15</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">26</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/LiuGaoyong" target="_blank" title="GitHub"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="http://weibo.com/LiuGaoyongYoung" target="_blank" title="Weibo"><i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://twitter.com/liugaoyong" target="_blank" title="Twitter"><i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://www.facebook.com/liugaoyong" target="_blank" title="FaceBook"><i class="fa fa-fw fa-facebook"></i>FaceBook</a>
                  
                </span>
              
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.github.com" title="Github 官网" target="_blank">Github 官网</a>
                  </li>
                
              </ul>
            </div>
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#一、Intel-Parallel-Studio-XE"><span class="nav-number">1.</span> <span class="nav-text">一、Intel_Parallel_Studio_XE</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二、openMPI"><span class="nav-number">2.</span> <span class="nav-text">二、openMPI</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-需要的安装包（官网）"><span class="nav-number">2.1.</span> <span class="nav-text">1. 需要的安装包（官网）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-安装步骤："><span class="nav-number">2.2.</span> <span class="nav-text">2. 安装步骤：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-测试mpi效果："><span class="nav-number">2.3.</span> <span class="nav-text">3. 测试mpi效果：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、编译VASP"><span class="nav-number">3.</span> <span class="nav-text">三、编译VASP</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-测试环境变量"><span class="nav-number">3.1.</span> <span class="nav-text">1. 测试环境变量</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#查看Intel-compiled环境"><span class="nav-number">3.1.1.</span> <span class="nav-text">查看Intel_compiled环境</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看Intel-fftw环境"><span class="nav-number">3.1.2.</span> <span class="nav-text">查看Intel_fftw环境</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-vasp源代码整理"><span class="nav-number">3.2.</span> <span class="nav-text">2. vasp源代码整理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#解压"><span class="nav-number">3.2.1.</span> <span class="nav-text">解压</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#整合VTST（可选）"><span class="nav-number">3.2.2.</span> <span class="nav-text">整合VTST（可选）</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#a-源代码中加入VTST："><span class="nav-number">3.2.2.1.</span> <span class="nav-text">a. 源代码中加入VTST：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#b-修改src-main-F源码："><span class="nav-number">3.2.2.2.</span> <span class="nav-text">b. 修改src/main.F源码：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#c-修改编译配置src-objects："><span class="nav-number">3.2.2.3.</span> <span class="nav-text">c. 修改编译配置src/.objects：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-vasp正式编译"><span class="nav-number">3.3.</span> <span class="nav-text">3. vasp正式编译</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四、VASP执行脚本"><span class="nav-number">4.</span> <span class="nav-text">四、VASP执行脚本</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-单主机并行脚本"><span class="nav-number">4.1.</span> <span class="nav-text">1. 单主机并行脚本</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-torque集群脚本（PBS）"><span class="nav-number">4.2.</span> <span class="nav-text">2. torque集群脚本（PBS）</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#参考网址"><span class="nav-number">5.</span> <span class="nav-text">参考网址</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">LiuGaoyong</span>

  

  
</div>




  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动 v3.7.1</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/theme-next/hexo-theme-next">NexT.Gemini</a> v6.1.0</div>




        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


























  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.1.0"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=6.1.0"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=6.1.0"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.1.0"></script>



  



	





  





  










  





  

  

  

  

  
  

  

  

  

  

</body>
</html>
